package com.bbx.taxi.client.Activity.Menu;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import butterknife.Bind;

import com.bbx.taxi.client.R;
import com.bbx.taxi.client.Activity.Base.BaseBBXActivity;
import com.bbx.taxi.client.Bean.Extra.ClauseMsg;

public class ClauseActivity extends BaseBBXActivity {
	@Bind(R.id.webView)WebView webview;
	private String uir_kj="file:///android_asset/clause_kj.html";  
	private String uir_service ="file:///android_asset/clause.html"; 
	private String uir_coupon ="file:///android_asset/coupon.html"; 
	private String uir_help ="file:///android_asset/help.html";
	protected void onCreate(Bundle savedInstanceState) {
		setContentView(R.layout.activity_clause);
		super.onCreate(savedInstanceState);
		
	}
	@Override
	protected void initView() {
		Intent intent=getIntent();
		if(intent.getExtras()!=null){
			switch(intent.getExtras().getInt(ClauseMsg.extra_clause)){
			case ClauseMsg.CLAUSE_KJ:
				webview.loadUrl(uir_kj);
				setTitle(getString(R.string.title_express_clause));
				break;
			case ClauseMsg.CLAUSE_SERVICE:
				webview.loadUrl(uir_service);
				setTitle(getString(R.string.title_service_clause));
				break;
			case ClauseMsg.CLAUSE_COUPON:
				webview.loadUrl(uir_coupon);
				setTitle(getString(R.string.title_coupon_clause));
				break;
			case ClauseMsg.CLAUSE_HELP:
				webview.loadUrl(uir_help);
				setTitle(getString(R.string.title_help));
				break;
			}
		}
//		webview.setWebViewClient(new WebViewClient() {
//			@Override
//			public boolean shouldOverrideUrlLoading(WebView view, String url) {
//				// TODO Auto-generated method stub
//				// 返回值是true的时候控制去WebView打开，为false调用系统浏览器或第三方浏览器
//				view.loadUrl(url);
//				return true;
//			}
//		});
	}

	@Override
	protected void initData() {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void onClick(View v) {
		switch(v.getId()){
		default:
			super.onClick(v);
			break;
		}
		
	}

}
